﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Helpers
{
    public static class JsonHelperEx
    {
        public static string ToJsonString(this object obj)
        {
            return JsonHelper.SerializeObject(obj);
        }

        public static T ToJsonObject<T>(this string json) where T : class
        {
            return JsonHelper.Deserialize<T>(json);
        }

        public static T ToJsonObject<T>(this string json, ref T anonymousTypeObject) where T : class
        {
            return JsonHelper.DeserializeAnonymousType<T>(json, ref anonymousTypeObject);
        }
    }
}
